package homework01;

public class Rectangle extends Shape{
    private double Width;
    private double Height;

    public Rectangle(double width, double height) {
        this.Width = width;
        this.Height = height;
    }

    public double getWidth() {
        return Width;
    }

    public void setWidth(double width) {
        this.Width = width;
    }

    public double getHeight() {
        return Height;
    }

    public void setHeight(double height) {
        this.Height = height;
    }

    @Override
    public void printlnfo() {
        System.out.println("Rectangle:Width = " + getWidth() + ",Height = " + getHeight());
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Rectangle rectangle)) return false;

        if (Double.compare(rectangle.Width, Width) != 0) return false;
        return Double.compare(rectangle.Height, Height) == 0;
    }
}
